package com.zhiyume.controller;

import com.zhiyume.dao.entity.TInformation;
import com.zhiyume.dao.entity.TInformationWithBLOBs;
import com.zhiyume.service.InformationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

/**
 * 返回H5详情页所需信息
 */

@Controller
@RequestMapping("/h5")
public class H5Controller {


    @Autowired
    private InformationService informationService;

    /*
     * 资讯H5展示测试
     */
    @RequestMapping("/h5Detail")
    public ModelAndView infoH5Detail(){

        TInformation tInformation = informationService.findInfoById(Long.valueOf("2017110117505100000"));
        List<TInformationWithBLOBs> tInformationList = informationService.getIntroInformationList(tInformation.getId(),5);

        ModelAndView modelAndView = new ModelAndView();
        modelAndView.addObject("tInformation",tInformation);
        modelAndView.addObject("list",tInformationList);
        modelAndView.setViewName("page/h5/information_detail");
        return modelAndView;
    }
}
